package com.newdjk.newdoctor.adapter;


import android.text.TextUtils;


import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.newdjk.newdoctor.R;
import com.newdjk.newdoctor.entity.PatientListDataEntity;
import com.newdjk.newdoctor.entity.PatientListEntity;
import com.newdjk.newdoctor.utils.GlideUtils;
import com.newdjk.newdoctor.view.CircleImageView;

import java.util.List;

public class PatientSelectAdapter extends BaseQuickAdapter<PatientListEntity.ReturnDataBean, BaseViewHolder> {
    private String TAG = "MyDiagnoseImageAdapter";
    private List<PatientListEntity.ReturnDataBean> datalist;



    public PatientSelectAdapter(@Nullable List<PatientListEntity.ReturnDataBean> data) {
        super(R.layout.patient_select_item, data);

        datalist = data;
    }

    @Override
    protected void convert(BaseViewHolder helper, final PatientListEntity.ReturnDataBean item) {
        String patientName= item.getPatientName();
        if (!TextUtils.isEmpty(patientName)) {
            helper.setText(R.id.tv_name, patientName + "");
        }
        else {
            helper.setText(R.id.tv_name, "**");
        }

        CircleImageView circleImageView = helper.itemView.findViewById(R.id.head_icon);
//        Glide.with(MyApplication.getContext())
//                .load(item.getPaPicturePath())
//                .dontAnimate()
//                .placeholder(R.drawable.doctor_default_img)
//                //.diskCacheStrategy(DiskCacheStrategy.ALL)
//                .into(circleImageView);
        GlideUtils.loadDoctorImage(item.getPaPicturePath(),circleImageView);
        }

}
